import { BaseLoader } from "./BaseLoader";
import ByteArray = require("bytearray-node")
//class DataLoader
    
    export  class DataLoader extends BaseLoader
    {
       

        public /* override */ getClass(): Class
        {
            return DataLoader;
        }

        public get bytesData(): ByteArray
        {
            return this._data;
        }

        public /* override */ initialize(arg1): void
        {
            if (!(arg1 is flash.utils.ByteArray)) 
            {
                throw new Error("DataResource can only handle ByteArrays.");
            }
            this._data = arg1;
            if (resourceInfo) 
            {
                resourceInfo.data = this._data;
            }
            onLoadCompleteHandler();
            return;
        }

        protected /* override */ onContentReady(arg1): Boolean
        {
            return !(this._data == null);
        }

        private /* var */_data: ByteArray=null;
    }
